package com.example.sw.myapp10052;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.widget.ListView;

import com.example.sw.myapp10052.Bean.Alamitem;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private ListView lv;
    //  alt回车 找到 inner class   Alamitem就ok了

    private List<Alamitem> itemList= new ArrayList<>();
    private NaozhongAdapter3 adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initView();
        setListener();

    }

    private void setListener() {


    }

    private void initView() {
//        lv.findViewById(R.id.lv);
          lv=findViewById(R.id.lv);
        //无参
        Alamitem a=new Alamitem();
        a.setTime("66:66");
        a.setIschecked(false);
        itemList.add(a);
        //有参
        Alamitem a1=new Alamitem("66:10",false);
        itemList.add(a1);
        Alamitem a2=new Alamitem("66:11",false);
        itemList.add(a2);


        Alamitem a3=new Alamitem("66:13",false);
        itemList.add(a3);
        Alamitem a4=new Alamitem("66:14",false);
        itemList.add(a4);

        Alamitem a5=new Alamitem("66:15",false);
        itemList.add(a5);
        Alamitem a6=new Alamitem("66:16",false);
        itemList.add(a6);

        adapter=new NaozhongAdapter3(MainActivity.this,R.layout.list_item,itemList);
        lv.setAdapter(adapter);



    }
}
